package com.lagou.controller;

import com.alibaba.fastjson.JSONObject;
import com.lagou.service.ConsumerComponent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {


    @Autowired
    ConsumerComponent consumerComponent;

    @GetMapping("/demo/hello")
    public JSONObject demo(){
        JSONObject json = new JSONObject();
        String hello = consumerComponent.sayHello("world", 0);
        System.out.println("result :" + hello);
        json.put("result",hello);
        return json;
    }

}
